<!--
 * @Author: your name
 * @Date: 2021-08-13 11:23:47
 * @LastEditTime: 2021-08-13 18:06:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \练习\5-flex.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伸缩盒布局</title>
    <style>
        html{
            font: 12px '微软雅黑';
        }
        body{
            margin: 0;
        }
        ul{
            margin: 0;padding: 0; list-style: none;
        }
        .wrapper{
            width: 1080px;
            margin:0 auto;
        }
        .xpsf{
            background-color:rgb(56, 204, 36);
        }
        .xpsf ul.p_list{
            background-color: cadetblue;
            display: flex;
            flex-direction: row;  /*定义主轴为x轴 */
            height: 500px;
            align-items: center;   /*定义伸缩盒容器中的子元素在交叉轴y轴上的排列方式*/
            justify-content: space-around;  /*定义伸缩盒容器中的子元素在主轴x上的排列方式*/
        }
        .xpsf ul.p_list > li{
            height: 50px;
        }
        .xpsf ul.p_list > li:nth-child(1){
            width: 100px;
            background-color: rgb(209, 31, 135);
            flex-basis: 100px;
            flex-grow: 1;
            flex-shrink: 1;
        }
        .xpsf ul.p_list > li:nth-child(2){
            width: 100px;
            background-color: burlywood;
            flex-grow: 1;            
        }
        .xpsf ul.p_list > li:nth-child(3){
            width: 100px;
            background-color: chartreuse;
            flex-grow: 2;
        }
        .xpsf ul.p_list > li:nth-child(4){
            width: 100px;
            background-color: darkblue;
            flex-grow: 2;
        }





        .rqtj{
            background-color: brown;
            height: 300px;
        }
        .jjsh{
            background-color: aquamarine;
            height: 300px;

        }
    </style>
</head>

<body>
    <!-- 容器 -->
    <div class="container">
        <!-- 新品首发 -->
        <div class="xpsf">
            <!-- 居中 -->
            <div class="wrapper">
                <ul class="p_list">
                    <li>1</li>
                    <li>2</li>
                    <li>3</li>
                    <li>4</li>
                </ul>
            </div>
        </div>
        <!-- 人气推荐 -->
        <div class="rqtj">
            <div class="wrapper">
                人气推荐
            </div>
        </div>
        <!-- 居家生活 -->
        <div class="jjsh">
            <div class="wrapper">
                居家生活
            </div>
        </div>
    </div>
</body>
</html>